#ifndef __MESSAGE_HPP__
#define __MESSAGE_HPP__
#include <string>
using std::string;

namespace wd{
enum TaskType {
    TASK_LOGIN_SECTION1 = 1, 		//客户->服务端
    TASK_LOGIN_SECTION1_RESP_OK,  	//服务端->客户
    TASK_LOGIN_SECTION1_RESP_ERROR, //服务端->客户
    TASK_LOGIN_SECTION2,			//客户->服务端
    TASK_LOGIN_SECTION2_RESP_OK,	//服务端->客户
    TASK_LOGIN_SECTION2_RESP_ERROR,	//服务端->客户
    TASK_REGISTER_SECTION1, 		//客户->服务端
    TASK_REGISTER_SECTION1_RESP_OK,  	//服务端->客户
    TASK_REGISTER_SECTION1_RESP_ERROR, //服务端->客户
    TASK_REGISTER_SECTION2,			//客户->服务端
    TASK_REGISTER_SECTION2_RESP_OK,	//服务端->客户
    TASK_REGISTER_SECTION2_RESP_ERROR,	//服务端->客户

    TASK_GET_CAMERA_DATA, //表明用户想获得摄像机数据
    TASK_GET_CAMERA_DATA_OK, //表明用户想获得摄像机数据
 };


struct Packet{
    int type;
    int length;
    string msg;
};

//登录验证
struct TLV{
    int type;
    int length;
    char data[1024];
};

//用来发送视频数据
struct TLV2{
    int type;
    int length;
    char * data;

    ~TLV2() {
        if(data) {
            delete [] data;
            printf("~TLV2() delete data\n"); 
        }
    }
};

#pragma pack(4)
struct CameraPacketHeader {
    int64_t pts;
    int64_t dts;
    int32_t size;
};
#pragma pack()

}

#endif // __MESSAGE_HPP__

